@extends('admin')

@section('content')
    <div class="h_a">搜索</div>
    <div class="search_type cc mb10">
        <form action="{{url('admin/his/recharge')}}" method="get" class="search_form">
            <label for="search_title">关键字：</label>
            <input type="text" name="subject" value="{{isset($appends['subject']) ? $appends['subject'] : ''}}" id="search_title" class="input length_2 mr10"/>
            <label for="state">充值渠道：</label>
            <select name="channel">
                <option value="">不限</option>
                @foreach($channel as $key=>$item)
                    <option value="{{$key}}" {{isset($appends['channel']) && $key == $appends['channel'] ? "selected='selected'" : ''}}>{{$item}}</option>
                @endforeach
            </select>
            <label for="state">状态：</label>
            <select name="state">
                <option value="">不限</option>
                @foreach($state as $key=>$user)
                    <option value="{{$key}}" {{isset($appends['state']) && $key == $appends['state'] ? "selected='selected'" : ''}}>{{$user}}</option>
                @endforeach
            </select>
            <button type="submit" class="btn">提交查询</button>
        </form>

    </div>

    <div class="table_list">
        <div id="data_list">
            <table class="items">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>合作者</th>
                    <th>工易上用户</th>
                    <th>付款方</th>
                    <th>收款方</th>
                    <th>充值渠道</th>
                    <th>收款方邮箱</th>
                    <th>付款方邮箱</th>
                    <th>总金额</th>
                    <th>发布时间</th>
                    <th>状态</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($list as $item)
                    <tr>
                        <td>{{$item->rechargeid}}</td>
                        <td>{{$item->partner}}</td>
                        <td>{{$item->partner}}</td>
                        <td>{{$item->buyerid}}</td>
                        <td>{{$item->sellerid}}</td>
                        <td>{{"" != $item->channel ? $channel[$item->channel] : ""}}</td>
                        <td>{{$item->selleremail}}</td>
                        <td>{{$item->buyeremail}}</td>
                        <td>￥{{sprintf("%.2f", $item->totalfee)}}</td>
                        <td>{{$item->inputtime}}</td>
                        <td>{{$state[$item->state]}}</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

        <div class="summary">
            共有 {{$list->total()}} 条数据
        </div>
        @if ($list->hasPages())
            <div class="pager">
                {!! $list->appends($appends)->render() !!}
            </div>
        @endif
    </div>
@stop